package com.qingcloud.adminbackend.entity.equipment;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 设备表基本信息表
 * </p>
 *
 */
@Data
public class EquipmentListPara extends Model {

    private static final long serialVersionUID = 1L;

    /**
     * 设备编号
     */
    @ApiModelProperty(value = "设备ID",example = "1190100001")
    private String equipmentId;
    @ApiModelProperty(value = "站点编号或名称", example = "17")
    private String stationIdOrName;
    @ApiModelProperty(value = "客户编号", example = "bc0846dc00ea4b00830bb93fb4123ac5")
    private List<String> orgIds;
    @ApiModelProperty(value = "订单编号", example = "a966a133831545a39bcb21d275a40fec")
    private List<String> orderIds;
    @ApiModelProperty(value = "设备编号", example = "")
    private List<String> equipmentIds;

    @ApiModelProperty(value = "设备池标志", example = "1")
    private String equipmentPoolFlag;
    private int poolFlag;

    @ApiModelProperty(value = "在线控制（0：支持；1不支持）",example = "0")
    private Integer onlineControl;
    @ApiModelProperty(value = "产品型号", example = "WM-SN100")
    private String productType;
    @ApiModelProperty(value = "产品", example = "1")
    private String product;
    @ApiModelProperty(value = "城市编号", example = "110100")
    private String domainId;
    @ApiModelProperty(value = "生产厂家", example = "蛙鸣")
    private String manufacturer;
    @ApiModelProperty(value = "物联网卡号", example = "18374758245")
    private String phoneNum;
    @ApiModelProperty(value = "监测因子", example = "7")
    private List<String> factors;
    @ApiModelProperty(value = "设备状态", example = "2")
    private List<String> statuses;
    @ApiModelProperty(value = "运行模式", example = "1")
    private List<String> runningModules;
    @ApiModelProperty(value = "绑定状态", example = "1")
    private List<String> mountStats;
    @ApiModelProperty(value = "绑定状态", example = "1")
    private int mountStatsStr;
    @ApiModelProperty(value = "设备类型", example = "2")
    private List<String> equipmentCatagorys;
    @ApiModelProperty(value = "合格标志", example = "1")
    private List<String> standardFlags;

    @ApiModelProperty(value = "待运维状态 6", example = "1")
    private Integer sensorStatus;

    @ApiModelProperty(value = "当前第几页", example = "0")
    private Integer currentPage;

    @ApiModelProperty(value = "每页多少条", example = "10")
    private Integer perPage;

    public void setMountStats(List<String> mountStats) {
        if (mountStats.size() == 1){
            mountStatsStr = Integer.parseInt(mountStats.get(0));
        }
        this.mountStats = mountStats;
    }

    public void setEquipmentPoolFlag(String equipmentPoolFlag) {
        if (StringUtils.isEmpty(equipmentPoolFlag)){
            equipmentPoolFlag = "0";
        }
        poolFlag = Integer.parseInt(equipmentPoolFlag);
        this.equipmentPoolFlag = equipmentPoolFlag;
    }
}

